package com.aidysoft.practice.propertiesToSetValue;

/**
 * 〈测试配置文件赋值〉
 */

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@Data
//该注解可以读取指定配置文件内容
@PropertySource("classpath:users2.properties")
//该注解会读取配置文件中该前缀属性
@ConfigurationProperties(prefix = "users2")
public class Users2 {
    private int age;
    private String name;

}
